function out=modelkalai(r,sigma,theta, A)
	size=length(r);
	u=@(x) 74.1752*x.^(0.6);
	c=@(x) 8.23249 *x.^(1.51678);
	uprime=@(x) 0.6*74.1752*x.^(0.6-1);
	cprime=@(x) 1.51678*8.23249 *x.^(1.51678-1);
	z=@(x) theta*c(x)+(1-theta)*u(x);
	foc=@(x) (uprime(x)-cprime(x))./(theta*cprime(x)+(1-theta)*uprime(x));
	solq=fsolve(@(x) foc(x)-(r./(sigma*theta)),[0.1*ones(size,1)]);
	balances=z(solq);
	out=balances./(sigma*balances+A);
end